/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import java.util.ArrayList;
import java.util.List;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;

/**
 *
 * @author TrongKhoa
 */
public class DataRowDTO
{
    private DataTableDTO _table;
    Element _rowElement;
    private ArrayList<Object> items;
    private Boolean _hasError;

    public DataRowDTO(DataTableDTO table, Element rowElement)
    {
        _table = table;
        _rowElement = rowElement;
        _hasError = false;
        items = new ArrayList<>();
        NamedNodeMap atts = _rowElement.getAttributes();
        for(int i = 0; i < atts.getLength(); i++)
        {
            items.add(((Attr)atts.item(i)).getValue());
        }
    }

    
    public Object GetData(String column)
    {
        return null;
    }
    public Object GetData(int index)
    {
        return null;
    }
    
    public void AcceptChange()
    {
        
    }
    
    public void BeginEdit()
    {
        
    }
    
    public void EndEdit()
    {
    }
    
    public void CacelEdit()
    {
        
    }
    
    public void Delete()
    {
    
    }

    public Boolean getHasError()
    {
        return _hasError;
    }

    public void setHasError(Boolean _hasError)
    {
        this._hasError = _hasError;
    }

    public DataTableDTO getTable()
    {
        return _table;
    }

    public void setTable(DataTableDTO _table)
    {
        this._table = _table;
    }

    public ArrayList<Object> getItems()
    {
        return items;
    }

    public void setItems(ArrayList<Object> items)
    {
        this.items = items;
    }
    
    
}
